#define DEBUG
#include <cstdio>
#include <cstring>

using namespace std;

typedef long long ll;
const int maxn=50, mods=998244353;

ll qpower(ll a, int n) {
	ll s=1;
	for (; n; n/=2) {
		if (n&1) s = s*a%mods;
		a = a*a%mods;
	}
	return s;
}

class Matrix {
	public:
		int n, m;
		ll v[maxn+1][maxn+1];

		void init(int r, int c) {
			n=r, m=c;
			memset(v, 0, sizeof v);
		}

		void swap(int a, int b) {
			ll temp;
			for (int i=1; i<=m; i++) {
				temp=v[a][i], v[a][i]=v[b][i], v[b][i]=temp;
			}
		}

		ll change() {
			ll ret=1;
			for (int i=1; i<=n; i++) {
				int t=i;
				for (; t<n && !v[t][i]; t++);
				if (t!=i) {
					swap(i, t);
					ret = mods-ret;
				}

				for (int j=i+1; j<=n; j++) {
					ll temp=v[j][i]*qpower(v[i][i], mods-2)%mods;
					for (int k=0; k<=m; k++) {
						v[j][k] = (v[j][k]+mods-v[i][k]*temp%mods)%mods;
					}
				}
			}

			for (int i=1; i<=n; i++) {
				ret = ret*v[i][i]%mods;
			}
			return ret;
		}

		void solve() {
			change();
			for (int i=n; i>0; i--) {
				for (int j=n; j>i; j--) {
					v[i][0] = (v[i][0]+mods-v[i][j]*v[j][0]%mods)%mods;
				}
				v[i][0] = v[i][0]*qpower(v[i][i], mods-2)%mods;
			}
		}
};

void buildTreeMatrix(Matrix &a, int n, int f[], int x) {
	a.init(n-1, n-1);
	for (int i=2; i<=n; i++) {
		a.v[f[i]][i]=mods-1, a.v[i][f[i]]=mods-1;
		a.v[i][i]++, a.v[f[i]][f[i]]++;
	}

	for (int i=1; i<=n; i++) {
		for (int j=i+1; j<=n; j++) {
			if (!a.v[i][j]) {
				a.v[i][j]=mods-x, a.v[j][i]=mods-x;
				a.v[i][i]+=x, a.v[j][j]+=x;
			}
		}
	}
}

int main() {
	freopen("b.in", "r", stdin);
	freopen("b.out", "w", stdout);

	static int f[maxn+1];
	int n, k;
	scanf("%d %d", &n, &k);
	for (int i=2; i<=n; i++) {
		scanf("%d", f+i);
		f[i]++;
	}

	static Matrix tree, ans;
	ans.init(n, n);
	for (int i=1; i<=n; i++) {
		buildTreeMatrix(tree, n, f, i);
		ans.v[i][0] = tree.change();
		ans.v[i][1] = 1;
		for (int j=2; j<=n; j++) {
			ans.v[i][j] = ans.v[i][j-1]*i%mods;
		}
	}
	ans.solve();

	ll sum=0;
	for (int i=1; i<=k+1; i++) {
		sum = (sum+ans.v[i][0])%mods;
	}
	printf("%lld", sum);

	fclose(stdin);
	fclose(stdout);
	return 0;
}
